﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Text;

namespace DONGTAIWANGYE
{
    public partial class 注册 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        

       
        

        protected void Button3_Click(object sender, EventArgs e)
        {
            string strCn = "server=pc.hstc.cn;database=dhd2014112117;uid=2014112117;pwd=19960218";
            SqlConnection cn = new SqlConnection(strCn);
            StringBuilder sb = new StringBuilder(1024);
            sb.Append("INSERT INTO UserInfo ");
            sb.Append("                (userName, Password,userAge, UserMail) ");
            sb.Append("VALUES   (@userName,@Password,@userAge,@UserMail) ");
            SqlParameter[] pms = new SqlParameter[4];
            pms[0] = new SqlParameter("@userName", this.txtUserName.Text);
            pms[1] = new SqlParameter("@Password", this.txtPassword.Text);
            pms[2] = new SqlParameter("@userAge", this.txtRange.Text);
            pms[3] = new SqlParameter("@UserMail", this.txtMail.Text);
            int intResult = SqlHelper.ExecuteNonQuery(sb.ToString(), pms);
            this.lblInfo2.Text = (intResult < 1) ? "新增失败！" : "新增" + intResult.ToString() + "个用户！";

        }

        
        protected void ButtonBack_Click(object sender, EventArgs e)
        {

        }
    }
}